package com.webdemo11.service.impl;

import java.util.List;

import com.webdemo11.dao.UserDao;
import com.webdemo11.pojo.User;
import com.webdemo11.service.UserService;
import com.webdemo11.util.SpringHandler;
public class UserServiceImpl implements UserService{
	private UserDao userDao;
	public UserDao getUserDao() {
		return userDao;
	}
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
		SpringHandler.showStatistics();
	}
	@Override
	public void deleteUser(User user) {
		userDao.deleteUser(user);
		SpringHandler.showStatistics();
	}
	@Override
	public void updateUser(User user) {
		userDao.updateUser(user);
		SpringHandler.showStatistics();
	}
	@Override
	public User getUser(int id) {
		User user = userDao.getUser(id);
		SpringHandler.showStatistics();
		return user;
	}
	@Override
	public List<User> getUsers() {
		List<User> users= userDao.getUsers();
		SpringHandler.showStatistics();
		return users;
	}
}
